import request from '@/utils/request'
import { GEN_SERVER } from '@/config/baseUrl'

//查询异常处理列表
export function handleList(data) {
  return request({
    url: GEN_SERVER['auxiliary-server'] + '/abnormal/order/handle/list',
    method: 'post',
    data: data
  })
}

//查询异常跟进列表
export function followList(data) {
  return request({
    url: GEN_SERVER['auxiliary-server'] + '/abnormal/order/follow/list',
    method: 'post',
    data: data
  })
}

//查询异常历史列表
export function historyList(data) {
  return request({
    url: GEN_SERVER['auxiliary-server'] + '/abnormal/order/history/list',
    method: 'post',
    data: data
  })
}

// 查询异常详情
export function abnormalDetail(data) {
  return request({
    url: GEN_SERVER['auxiliary-server'] + '/abnormal/order/detail',
    method: 'get',
    params: data
  })
}

// 异常处理
export function abnormalHandle(data) {
  return request({
    url: GEN_SERVER['auxiliary-server'] + '/abnormal/order/handle',
    method: 'post',
    data: data
  })
}

// 异常忽略
export function abnormalIgnore(data) {
  return request({
    url: GEN_SERVER['auxiliary-server'] + '/abnormal/order/ignore',
    method: 'post',
    data: data
  })
}

// 批量异常忽略
export function batchIgnore(data) {
  return request({
    url: GEN_SERVER['auxiliary-server'] + '/abnormal/order/batch/ignore',
    method: 'post',
    data: data
  })
}

// 异常转办
export function abnormalTransfer(data) {
  return request({
    url: GEN_SERVER['auxiliary-server'] + '/abnormal/order/transfer',
    method: 'post',
    data:data
  })
}

// 新增或保存异常
export function abnormalAddOrUpdate(data) {
  return request({
    url: GEN_SERVER['auxiliary-server'] + '/abnormal/order/addOrUpdate',
    method: 'post',
    data: data
  })
}

// 获取历史异常
export function historysAbnormal(data) {
  return request({
    url: GEN_SERVER['auxiliary-server'] + '/abnormal/order/historys',
    method: 'post',
    data: data
  })
}

// 获取关联异常
export function associatedsAbnormal(data) {
  return request({
    url: GEN_SERVER['auxiliary-server'] + '/abnormal/order/associateds',
    method: 'post',
    data: data
  })
}

// 导出异常
export function exportAbnormal(data) {
  return request({
    url: GEN_SERVER['auxiliary-server'] + "/abnormal/order/exportAbnormalOrderByDoing",
    method: "post",
    data,
    responseType: "blob",
  });
}

// 导出异常
export function exportAbnormalHistory(data) {
  return request({
    url: GEN_SERVER['auxiliary-server'] + "/abnormal/order/exportAbnormalOrderByHistory",
    method: "post",
    data,
    responseType: "blob",
  });
}